﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProxyWrapper.CommonProxyService;
using System.Data;
using ProxyWrapper.ServicesProxy;
namespace ProxyWrapper
{
    public class ServicesServiceWrapper
    {
        CommonServiceSoapClient client = null;
        public DataSet GetServiceList(int clientId, string hashCode)
        {
            client = new CommonServiceSoapClient();
            return client.GetServices(clientId, hashCode);
        }

        public string[] CreateRecordScansService(string serviceName, string serviceType, string serviceSubType, int userId, string hashCode, string serviceDes, string serviceDetail,string imageURL,string serviceURL)
        {
            client = new CommonServiceSoapClient();
            return client.CreateRecordScansService(serviceName, serviceType, serviceSubType, userId, hashCode, serviceDes, serviceDetail,imageURL,serviceURL);
        }
        public string CreateValidateScanService(ValidateScan _scan)
        {
            client = new CommonServiceSoapClient();
            return client.CreateValidateScansService(_scan);
        }
        public List<ServiceDetails> GetServiceDetailsList(int clientId, string hashCode)
        {
            client = new CommonServiceSoapClient();
            ServiceDetails[] _detail = client.GetServiceDetailsList(clientId, hashCode);
            return _detail!=null ? _detail.ToList<ServiceDetails>():new List<ServiceDetails>();
        }

        public void UpdateService(UserProxy.UserDetails UserDetails, int ServiceId, string serviceName, string serviceDetail)
        {
            client = new CommonServiceSoapClient();
            client.UpdateSerice(UserDetails.UserId, UserDetails.HashCode, ServiceId, serviceName, serviceDetail);
            
        }

        public string AssociateDBToService(int dbId, int[] serviceId, int loggedInUserId)
        {
            client = new CommonServiceSoapClient();
            return client.AssociateDBToService(dbId, serviceId, loggedInUserId);
        }

        public string DeleteService(int serviceId, string hashCode)
        {
            return new ServicesSoapClient().DeleteService(serviceId, hashCode);
           // return "";
        }

        public ServiceProperties GetServiceProperties(int clientId,int serviceId)
        {
            return new CommonServiceSoapClient().GetServiceProperties(clientId, serviceId);
        }
            
        public string AddServiceProperties(int serviceId,int clientId,ServiceProperties srvProperties)
        {
            return new CommonServiceSoapClient().AddServiceProperties(serviceId, clientId, srvProperties);
        }
    }
}
